package com.leyou.dto;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Objects;

@Data
@Accessors(chain = true)
public class FriendsDto implements Serializable, Cloneable {

    private Long id;
    private String name;
    private Integer age;

    public FriendsDto() {
    }



    public void setId() {
        id=4334L;
    }

    public FriendsDto(String name, Integer age) {
        this.name = name;

        this.age = age;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof FriendsDto)) return false;
        if (!super.equals(o)) return false;
        FriendsDto that = (FriendsDto) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(name, that.name) &&
                Objects.equals(age, that.age);
    }

    @Override
    public int hashCode() {

        return Objects.hash(super.hashCode(), id, name, age);
    }

    @Override
    public Object clone() {
        Object o = null;
        try {
            o = super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return o;

    }


}
